﻿using Microsoft.Xna.Framework.Content;

namespace Phoenix.Xna.Framework
{
    /// <summary>
    /// The base class for all engine components.
    /// </summary>
    public abstract class EngineComponent : IEngineComponent
    {
        /// <summary>
        /// Initializes a new instance of the EngineComponent class.
        /// </summary>
        public EngineComponent()
            : this(ShortGuid.NewGuid().ToString())
        {
        }

        /// <summary>
        /// Initializes a new instance of the EngineComponent class.
        /// </summary>
        /// <param name="id"></param>
        public EngineComponent(string id)
        {
            ID = id;
        }

        #region IEngineComponent Members

        /// <summary>
        /// Gets or sets the ID of the EngineComponent.
        /// </summary>
        [ContentSerializerIgnore]
        public string ID { get; set; }

        #endregion
    }
}
